package core.database.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "members")
public class Member implements Serializable {
	private static final long serialVersionUID = -1592239096185532030L;
	
	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id = null;
	@Column(name = "name", length = 45)
	private String name;
	@Column(name = "surname", length = 45)
	private String surname;
	@Column(name = "address")
	private String address;
	@Column(name = "identificationField", nullable = false, unique = true, length = 45)
	private String identificationField;
	@OneToMany
	@JoinColumn(name = "member")
	private Set<AdministratorToken> tokens = new HashSet<AdministratorToken>();

	public Long getId() {
		return id;
	}

	@SuppressWarnings("unused")
	private void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getIdentificationField() {
		return identificationField;
	}

	public void setIdentificationField(String identificationField) {
		this.identificationField = identificationField;
	}

	public Set<AdministratorToken> getTokens() {
		return tokens;
	}

	public void setTokens(HashSet<AdministratorToken> tokens) {
		this.tokens = tokens;
	}
}
